#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <cstring>
#include <vector>
#include<queue>
using namespace std;
int main()
{
	int t;
	long long y = 1000000000000000000;
	scanf_s("%d", &t);
	while (t--)
	{
		long long x;
		scanf_s("%lld", &x);
		printf("%lld\n", y - x);
	}
	return 0;
}